#include <iostream>
#include <algorithm>
using namespace std;

void check(long long ans)
{
    if(ans < 2)
    {
        cout << "noprime" << endl;
        return;
    }
    for(long long i = 2;i <= ans / i;i++)
    {
        if(ans % i == 0)
        {
            cout << "noprime" << endl;
            return;
        }
    }
    cout << "prime" << endl;
}

int main() {
    string s;
    cin >> s;
    string ss = s;
    reverse(s.begin(),s.end());
    ss += string(s.begin() + 1,s.end());
    long long ans = atol(ss.c_str());
    check(ans);
    return 0;
}
// 64 位输出请用 printf("%lld")